<html>
<head>
  <title>Administer Postfix Mail Delivery</title>
</head>
<body>
{% if message %}
  <b>{{ message }}</ b>
  <p />
{% endif %}

<h2>Mail Domains</h2>
<h4>These are the domains for which Postfix, running on this machine, will accept email for delivery to local accounts.</h4>
{% if domain_list %}
	<table>
	  {% for domain in domain_list %}
	  <tr bgcolor='{% cycle FFFFFF,EEEEEE as rowcolor %}'>
	    <td>{{ domain.domain }}</td>
	    <td><a href='{{ request.path }}?MailDomain_edit_id={{ domain.id }}'>Edit</a></td>
	    <td><a href='{{ request.path }}?MailDomain_delete_id={{ domain.id }}'>Delete</a></td>
	  </tr>
	  {% endfor %}
	</table>
	<p />
{% else %}
    <p>No domains yet.</p>
{% endif %}
<form action='{{ request.path }}' method='POST'>
<input type='hidden' name='MailDomain_edit_id' value='{{ MailDomain_edit_id }}'>
<table>
{{ domainform }}
<tr>
  <td colspan=2 align=right>
    <input type=submit name='MailDomain_submit_action' value='{{ MailDomain_submit_action }}'>
  </td>
</tr>
</table>
</form>
{% ifnotequal MailDomain_submit_action 'Add' %}
  <p />
  <a href='{{ request.path }}'>Add New Domain</a>
{% endifnotequal %}
<hr />
<h2>Mail Accounts</h2>
<h4>These are the mail accounts on the system. Postfix will accept all mail intended for them, and it can be retrieved from the server with POP3 or IMAP. Postfix will also allow them to send email.</h4>
{% if users %}
	<table>
	  {% for user in users %}
	  <tr bgcolor='{% cycle FFFFFF,EEEEEE as rowcolor %}'>
	    <td>{{ user.address }}</td>
	    <td><a href='{{ request.path }}?MailUser_edit_id={{ user.address }}'>Edit</a></td>
	    <td><a href='{{ request.path }}?MailUser_delete_id={{ user.address }}'>Delete</a></td>
	  </tr>
	  {% endfor %}
	</table>
	<p />
{% else %}
    <p>No users yet.</p>
{% endif %}
<form action='{{ request.path }}' method='POST'>
<input type='hidden' name='MailUser_edit_id' value='{{ MailUser_edit_id }}'>
<table>
{{ accountform }}
<tr>
  <td colspan=2 align=right>
    <input type=submit name='MailUser_submit_action' value='{{ MailUser_submit_action }}'>
  </td>
</tr>
</table>
</form>
{% ifnotequal MailUser_submit_action 'Add' %}
  <p />
  <a href='{{ request.path }}'>Add New Account</a>
{% endifnotequal %}
<hr />
<h2>Mail Forwarders</h2>
{% if forwarders %}
    <ul>
    {% for alias in forwarders %}
        <li>{{ alias.address }}<br />{{ alias.forwards_to }}</li>
    {% endfor %}
    </ul>
{% else %}
    <p>No forwarders yet.</p>
{% endif %}
<form action='{{ request.path }}' method='POST'>
<input type='hidden' name='MailAlias_edit_id' value='{{ MailAlias_edit_id }}'>
<table>
{{ aliasform }}
<tr>
  <td colspan=2 align=right>
    <input type=submit name='MailAlias_submit_action' value='{{ MailAlias_submit_action }}'>
  </td>
</tr>
</table>
</form>
{% ifnotequal MailAlias_submit_action 'Add' %}
  <p />
  <a href='{{ request.path }}'>Add New Forwarder</a>
{% endifnotequal %}
</body>
</html>
